package com.cdd.framework.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cdd.framework.web.domain.SysLogininfor;
import com.cdd.framework.web.mapper.SysLogininforMapper;
import com.cdd.framework.web.service.ISysLogininforService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * 系统访问日志情况信息 服务层处理
 *
 * @author lc
 */
@Service
public class SysLogininforServiceImpl implements ISysLogininforService
{

    @Resource
    private SysLogininforMapper loginInfoMapper;

    /**
     * 新增系统登录日志
     */
    @Override
    public void insert(SysLogininfor loginInfo)
    {
        loginInfoMapper.insert(loginInfo);
    }

    @Override
    public List<SysLogininfor> selectList(SysLogininfor logininfor) {
        return loginInfoMapper.selectList(new LambdaQueryWrapper<>());
    }

    @Override
    public int deleteByIds(Long[] infoIds) {
        return loginInfoMapper.deleteBatchIds(Arrays.asList(infoIds));
    }

    @Override
    public void clean() {
        loginInfoMapper.clear();
    }

}
